package com.sc.nft.service;

import com.sc.nft.entity.*;
import com.sc.nft.enums.IncomeTypeEnum;
import com.sc.nft.exception.GlobalException;
import com.sc.nft.vo.profittemplate.ProfitTemplateGetProfitAndPointsVO;

import java.math.BigDecimal;
import java.util.List;

public interface MallOrderIncomeService {

    /**
     * 计算收益
     */
    void calculateIncome(List<MallOrderProduct> orderProdcutList, MallOrder mallOrder, UserInfo user);

    /**
     * 新计算收益
     *
     * @param orderProdcutList
     * @param mallOrder
     * @param user
     */
    void newCalCulateIncome(List<MallOrderProduct> orderProdcutList, MallOrder mallOrder, UserInfo user);

    /**
     * 小程序订单新计算收益
     *
     * @param orderProdcutList
     * @param mallOrder
     * @param wxMiniUserInfo
     */
    ProfitTemplateGetProfitAndPointsVO wxMiniNewCalCulateIncome(List<MallOrderProduct> orderProdcutList, MallOrder mallOrder, WxMiniUserInfo wxMiniUserInfo);

    /**
     * 获取要结算的收益列表
     *
     * @return
     */
    List<MallOrderIncome> getSettlementIncomeList();

    /**
     * 结算收益
     *
     * @param mallOrderIncome
     */
    void settlementIncome(MallOrderIncome mallOrderIncome) throws GlobalException;

    /**
     * 结算收益
     *
     * @param mallOrderIncome
     */
    void newSettlementIncome(MallOrderIncome mallOrderIncome) throws GlobalException;

    /**
     * 查询收益
     *
     * @param incomeUserId
     * @param incomeTypeEnum
     * @param orderId
     * @return
     */
    MallOrderIncome getOneByIncomeUserIdAndIncomeTypeAndOrderId(Long incomeUserId, IncomeTypeEnum incomeTypeEnum, Long orderId);

    /**
     * 获取订单的收益
     *
     * @param orderId
     * @return
     */
    List<MallOrderIncome> getListByOrderId(Long orderId);

    /**
     * 获取微信小程序用户的待结算佣金
     *
     * @param wxMiniUserId
     * @return
     */
    BigDecimal getToBeSettledWxMiniUserCommission(Long wxMiniUserId);
}
